import request from "@/utils/request";

const api_name = `/api/user`;

export default {
  // 登录
  login(userInfo) {
    return request({
      url: `${api_name}/login`,
      method: `post`,
      data: userInfo,
    });
  },
  // 获取用户信息
  getUserInfo() {
    return request({
      url: `${api_name}/auth/getUserInfo`,
      method: `get`,
    });
  },
  // 保存用户信息【也可以理解为提交到后端】
  saveUserAuth(userAuth) {
    return request({
      url: `${api_name}/auth/userAuth`,
      method: "post",
      data: userAuth,
    });
  },
};
